import { http } from '@/server'
import type { HttpResponsePending } from '@/server/interface'
import type { RoleInfo, UserInfo } from './interface'

/** 获取用户信息 */
export const fetchUserInfo = (): HttpResponsePending<UserInfo> => http.get(`/o/v1/users/info`)

/** 通过Secret获取用户身份 */
export const fetchUserInfoBySecret = (secret: string): HttpResponsePending<RoleInfo> =>
    http.get('/report/secret-code', { params: { secret } })
